{% extends 'base.html' %}

{% load staticfiles %}

{% block content %}

<div class="box highlight">
    <div class="inner tab_title"> <a href="javascript:void(0);">最新主题</a></div>
    {% if lastest_topic_list %}
        {% for topic in lastest_topic_list %}
            <div class="cell item"> 
                <span class="user"></span>
                <h5><a href="{% url 'bbs:topic' topic.id %}">{{topic.title}}</a></h5>
                <div class="info">
                    <a class="node" href="{% url 'bbs:node' topic.node.id %}">{{topic.node.name}}</a>
                    <strong><a href="#">{{topic.author.username}}</a></strong> {{topic.pub_date}} 
                    最后回复来自
                    <strong><a href="#">{{topic.last_reply.author.username}}</a></strong>.
                </div>
                <a class="count_livid" href="javascript:void(0);">{{topic.reply_count}}</a>
            </div>
        {% endfor %}
    {% endif %}
</div>
<div class="box">
    <div class="inner tab_title"> <a href="#">节点导航</a><!-- <a href="#" class="text-right">浏览全部节点</a> --></div>
    {% if category_list %}
        {% for cate in category_list %}
            <div class="cell item">
                <p class="node-title">{{cate.name}}</p>
                <div class="node-item"> 
                 {% if cate.node_set.all %}
                    {% for node in cate.node_set.all %}
                    <a href="{% url 'bbs:node' node.id %}">{{node.name}}</a>
                    {% endfor %}
                {% endif %}
                </div>
            </div>
        {% endfor %}
    {% endif %}
</div>
{% endblock %}